import 'package:flutter_deer/generated/json/base/json_convert_content.dart';
import 'package:flutter_deer/database/beans/member_bean_entity.dart';

MemberBeanEntity $MemberBeanEntityFromJson(Map<String, dynamic> json) {
  final MemberBeanEntity memberBeanEntity = MemberBeanEntity();
  final dynamic memberAccount = json['memberAccount'];
  if (memberAccount != null) {
    memberBeanEntity.memberAccount = memberAccount;
  }
  final List<MemberBeanMembers>? members = (json['members'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<MemberBeanMembers>(e) as MemberBeanMembers).toList();
  if (members != null) {
    memberBeanEntity.members = members;
  }
  final String? payOrderId = jsonConvert.convert<String>(json['payOrderId']);
  if (payOrderId != null) {
    memberBeanEntity.payOrderId = payOrderId;
  }
  return memberBeanEntity;
}

Map<String, dynamic> $MemberBeanEntityToJson(MemberBeanEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['memberAccount'] = entity.memberAccount;
  data['members'] = entity.members?.map((v) => v.toJson()).toList();
  data['payOrderId'] = entity.payOrderId;
  return data;
}

extension MemberBeanEntityExtension on MemberBeanEntity {
  MemberBeanEntity copyWith({
    dynamic memberAccount,
    List<MemberBeanMembers>? members,
    String? payOrderId,
  }) {
    return MemberBeanEntity()
      ..memberAccount = memberAccount ?? this.memberAccount
      ..members = members ?? this.members
      ..payOrderId = payOrderId ?? this.payOrderId;
  }
}

MemberBeanMembers $MemberBeanMembersFromJson(Map<String, dynamic> json) {
  final MemberBeanMembers memberBeanMembers = MemberBeanMembers();
  final MemberBeanMembersAccountSumInfoResponse? accountSumInfoResponse = jsonConvert.convert<MemberBeanMembersAccountSumInfoResponse>(json['accountSumInfoResponse']);
  if (accountSumInfoResponse != null) {
    memberBeanMembers.accountSumInfoResponse = accountSumInfoResponse;
  }
  final String? avatar = jsonConvert.convert<String>(json['avatar']);
  if (avatar != null) {
    memberBeanMembers.avatar = avatar;
  }
  final String? levelName = jsonConvert.convert<String>(json['levelName']);
  if (levelName != null) {
    memberBeanMembers.levelName = levelName;
  }
  final String? mchCode = jsonConvert.convert<String>(json['mchCode']);
  if (mchCode != null) {
    memberBeanMembers.mchCode = mchCode;
  }
  final String? mchMemberId = jsonConvert.convert<String>(json['mchMemberId']);
  if (mchMemberId != null) {
    memberBeanMembers.mchMemberId = mchMemberId;
  }
  final MemberBeanMembersMemberIntegral? memberIntegral = jsonConvert.convert<MemberBeanMembersMemberIntegral>(json['memberIntegral']);
  if (memberIntegral != null) {
    memberBeanMembers.memberIntegral = memberIntegral;
  }
  final String? memberLevelType = jsonConvert.convert<String>(json['memberLevelType']);
  if (memberLevelType != null) {
    memberBeanMembers.memberLevelType = memberLevelType;
  }
  final List<MemberBeanMembersMemberPlates>? memberPlates = (json['memberPlates'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<MemberBeanMembersMemberPlates>(e) as MemberBeanMembersMemberPlates).toList();
  if (memberPlates != null) {
    memberBeanMembers.memberPlates = memberPlates;
  }
  final String? merchantMemberLevelId = jsonConvert.convert<String>(json['merchantMemberLevelId']);
  if (merchantMemberLevelId != null) {
    memberBeanMembers.merchantMemberLevelId = merchantMemberLevelId;
  }
  final String? nickname = jsonConvert.convert<String>(json['nickname']);
  if (nickname != null) {
    memberBeanMembers.nickname = nickname;
  }
  final bool? password = jsonConvert.convert<bool>(json['password']);
  if (password != null) {
    memberBeanMembers.password = password;
  }
  final String? phone = jsonConvert.convert<String>(json['phone']);
  if (phone != null) {
    memberBeanMembers.phone = phone;
  }
  final List<MemberBeanMembersSimpleTagInfoResponses>? simpleTagInfoResponses = (json['simpleTagInfoResponses'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<MemberBeanMembersSimpleTagInfoResponses>(e) as MemberBeanMembersSimpleTagInfoResponses).toList();
  if (simpleTagInfoResponses != null) {
    memberBeanMembers.simpleTagInfoResponses = simpleTagInfoResponses;
  }
  return memberBeanMembers;
}

Map<String, dynamic> $MemberBeanMembersToJson(MemberBeanMembers entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['accountSumInfoResponse'] = entity.accountSumInfoResponse?.toJson();
  data['avatar'] = entity.avatar;
  data['levelName'] = entity.levelName;
  data['mchCode'] = entity.mchCode;
  data['mchMemberId'] = entity.mchMemberId;
  data['memberIntegral'] = entity.memberIntegral?.toJson();
  data['memberLevelType'] = entity.memberLevelType;
  data['memberPlates'] = entity.memberPlates?.map((v) => v.toJson()).toList();
  data['merchantMemberLevelId'] = entity.merchantMemberLevelId;
  data['nickname'] = entity.nickname;
  data['password'] = entity.password;
  data['phone'] = entity.phone;
  data['simpleTagInfoResponses'] = entity.simpleTagInfoResponses?.map((v) => v.toJson()).toList();
  return data;
}

extension MemberBeanMembersExtension on MemberBeanMembers {
  MemberBeanMembers copyWith({
    MemberBeanMembersAccountSumInfoResponse? accountSumInfoResponse,
    String? avatar,
    String? levelName,
    String? mchCode,
    String? mchMemberId,
    MemberBeanMembersMemberIntegral? memberIntegral,
    String? memberLevelType,
    List<MemberBeanMembersMemberPlates>? memberPlates,
    String? merchantMemberLevelId,
    String? nickname,
    bool? password,
    String? phone,
    List<MemberBeanMembersSimpleTagInfoResponses>? simpleTagInfoResponses,
  }) {
    return MemberBeanMembers()
      ..accountSumInfoResponse = accountSumInfoResponse ?? this.accountSumInfoResponse
      ..avatar = avatar ?? this.avatar
      ..levelName = levelName ?? this.levelName
      ..mchCode = mchCode ?? this.mchCode
      ..mchMemberId = mchMemberId ?? this.mchMemberId
      ..memberIntegral = memberIntegral ?? this.memberIntegral
      ..memberLevelType = memberLevelType ?? this.memberLevelType
      ..memberPlates = memberPlates ?? this.memberPlates
      ..merchantMemberLevelId = merchantMemberLevelId ?? this.merchantMemberLevelId
      ..nickname = nickname ?? this.nickname
      ..password = password ?? this.password
      ..phone = phone ?? this.phone
      ..simpleTagInfoResponses = simpleTagInfoResponses ?? this.simpleTagInfoResponses;
  }
}

MemberBeanMembersAccountSumInfoResponse $MemberBeanMembersAccountSumInfoResponseFromJson(Map<String, dynamic> json) {
  final MemberBeanMembersAccountSumInfoResponse memberBeanMembersAccountSumInfoResponse = MemberBeanMembersAccountSumInfoResponse();
  final String? freezeAccountAmountSum = jsonConvert.convert<String>(json['freezeAccountAmountSum']);
  if (freezeAccountAmountSum != null) {
    memberBeanMembersAccountSumInfoResponse.freezeAccountAmountSum = freezeAccountAmountSum;
  }
  final String? indAccountAmountSum = jsonConvert.convert<String>(json['indAccountAmountSum']);
  if (indAccountAmountSum != null) {
    memberBeanMembersAccountSumInfoResponse.indAccountAmountSum = indAccountAmountSum;
  }
  final int? indAccountSum = jsonConvert.convert<int>(json['indAccountSum']);
  if (indAccountSum != null) {
    memberBeanMembersAccountSumInfoResponse.indAccountSum = indAccountSum;
  }
  final String? subAccountAmountSum = jsonConvert.convert<String>(json['subAccountAmountSum']);
  if (subAccountAmountSum != null) {
    memberBeanMembersAccountSumInfoResponse.subAccountAmountSum = subAccountAmountSum;
  }
  final int? subAccountSum = jsonConvert.convert<int>(json['subAccountSum']);
  if (subAccountSum != null) {
    memberBeanMembersAccountSumInfoResponse.subAccountSum = subAccountSum;
  }
  return memberBeanMembersAccountSumInfoResponse;
}

Map<String, dynamic> $MemberBeanMembersAccountSumInfoResponseToJson(MemberBeanMembersAccountSumInfoResponse entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['freezeAccountAmountSum'] = entity.freezeAccountAmountSum;
  data['indAccountAmountSum'] = entity.indAccountAmountSum;
  data['indAccountSum'] = entity.indAccountSum;
  data['subAccountAmountSum'] = entity.subAccountAmountSum;
  data['subAccountSum'] = entity.subAccountSum;
  return data;
}

extension MemberBeanMembersAccountSumInfoResponseExtension on MemberBeanMembersAccountSumInfoResponse {
  MemberBeanMembersAccountSumInfoResponse copyWith({
    String? freezeAccountAmountSum,
    String? indAccountAmountSum,
    int? indAccountSum,
    String? subAccountAmountSum,
    int? subAccountSum,
  }) {
    return MemberBeanMembersAccountSumInfoResponse()
      ..freezeAccountAmountSum = freezeAccountAmountSum ?? this.freezeAccountAmountSum
      ..indAccountAmountSum = indAccountAmountSum ?? this.indAccountAmountSum
      ..indAccountSum = indAccountSum ?? this.indAccountSum
      ..subAccountAmountSum = subAccountAmountSum ?? this.subAccountAmountSum
      ..subAccountSum = subAccountSum ?? this.subAccountSum;
  }
}

MemberBeanMembersMemberIntegral $MemberBeanMembersMemberIntegralFromJson(Map<String, dynamic> json) {
  final MemberBeanMembersMemberIntegral memberBeanMembersMemberIntegral = MemberBeanMembersMemberIntegral();
  final String? accountBalance = jsonConvert.convert<String>(json['accountBalance']);
  if (accountBalance != null) {
    memberBeanMembersMemberIntegral.accountBalance = accountBalance;
  }
  final String? accountStatus = jsonConvert.convert<String>(json['accountStatus']);
  if (accountStatus != null) {
    memberBeanMembersMemberIntegral.accountStatus = accountStatus;
  }
  final String? accountType = jsonConvert.convert<String>(json['accountType']);
  if (accountType != null) {
    memberBeanMembersMemberIntegral.accountType = accountType;
  }
  final String? consumeAmount = jsonConvert.convert<String>(json['consumeAmount']);
  if (consumeAmount != null) {
    memberBeanMembersMemberIntegral.consumeAmount = consumeAmount;
  }
  final String? createName = jsonConvert.convert<String>(json['createName']);
  if (createName != null) {
    memberBeanMembersMemberIntegral.createName = createName;
  }
  final String? createTime = jsonConvert.convert<String>(json['createTime']);
  if (createTime != null) {
    memberBeanMembersMemberIntegral.createTime = createTime;
  }
  final String? earnAmount = jsonConvert.convert<String>(json['earnAmount']);
  if (earnAmount != null) {
    memberBeanMembersMemberIntegral.earnAmount = earnAmount;
  }
  final String? entityType = jsonConvert.convert<String>(json['entityType']);
  if (entityType != null) {
    memberBeanMembersMemberIntegral.entityType = entityType;
  }
  final String? entityTypeId = jsonConvert.convert<String>(json['entityTypeId']);
  if (entityTypeId != null) {
    memberBeanMembersMemberIntegral.entityTypeId = entityTypeId;
  }
  final String? expireAmount = jsonConvert.convert<String>(json['expireAmount']);
  if (expireAmount != null) {
    memberBeanMembersMemberIntegral.expireAmount = expireAmount;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    memberBeanMembersMemberIntegral.id = id;
  }
  final int? isDeleted = jsonConvert.convert<int>(json['isDeleted']);
  if (isDeleted != null) {
    memberBeanMembersMemberIntegral.isDeleted = isDeleted;
  }
  final String? mchCode = jsonConvert.convert<String>(json['mchCode']);
  if (mchCode != null) {
    memberBeanMembersMemberIntegral.mchCode = mchCode;
  }
  final String? phone = jsonConvert.convert<String>(json['phone']);
  if (phone != null) {
    memberBeanMembersMemberIntegral.phone = phone;
  }
  final String? updateName = jsonConvert.convert<String>(json['updateName']);
  if (updateName != null) {
    memberBeanMembersMemberIntegral.updateName = updateName;
  }
  final String? updateTime = jsonConvert.convert<String>(json['updateTime']);
  if (updateTime != null) {
    memberBeanMembersMemberIntegral.updateTime = updateTime;
  }
  return memberBeanMembersMemberIntegral;
}

Map<String, dynamic> $MemberBeanMembersMemberIntegralToJson(MemberBeanMembersMemberIntegral entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['accountBalance'] = entity.accountBalance;
  data['accountStatus'] = entity.accountStatus;
  data['accountType'] = entity.accountType;
  data['consumeAmount'] = entity.consumeAmount;
  data['createName'] = entity.createName;
  data['createTime'] = entity.createTime;
  data['earnAmount'] = entity.earnAmount;
  data['entityType'] = entity.entityType;
  data['entityTypeId'] = entity.entityTypeId;
  data['expireAmount'] = entity.expireAmount;
  data['id'] = entity.id;
  data['isDeleted'] = entity.isDeleted;
  data['mchCode'] = entity.mchCode;
  data['phone'] = entity.phone;
  data['updateName'] = entity.updateName;
  data['updateTime'] = entity.updateTime;
  return data;
}

extension MemberBeanMembersMemberIntegralExtension on MemberBeanMembersMemberIntegral {
  MemberBeanMembersMemberIntegral copyWith({
    String? accountBalance,
    String? accountStatus,
    String? accountType,
    String? consumeAmount,
    String? createName,
    String? createTime,
    String? earnAmount,
    String? entityType,
    String? entityTypeId,
    String? expireAmount,
    String? id,
    int? isDeleted,
    String? mchCode,
    String? phone,
    String? updateName,
    String? updateTime,
  }) {
    return MemberBeanMembersMemberIntegral()
      ..accountBalance = accountBalance ?? this.accountBalance
      ..accountStatus = accountStatus ?? this.accountStatus
      ..accountType = accountType ?? this.accountType
      ..consumeAmount = consumeAmount ?? this.consumeAmount
      ..createName = createName ?? this.createName
      ..createTime = createTime ?? this.createTime
      ..earnAmount = earnAmount ?? this.earnAmount
      ..entityType = entityType ?? this.entityType
      ..entityTypeId = entityTypeId ?? this.entityTypeId
      ..expireAmount = expireAmount ?? this.expireAmount
      ..id = id ?? this.id
      ..isDeleted = isDeleted ?? this.isDeleted
      ..mchCode = mchCode ?? this.mchCode
      ..phone = phone ?? this.phone
      ..updateName = updateName ?? this.updateName
      ..updateTime = updateTime ?? this.updateTime;
  }
}

MemberBeanMembersMemberPlates $MemberBeanMembersMemberPlatesFromJson(Map<String, dynamic> json) {
  final MemberBeanMembersMemberPlates memberBeanMembersMemberPlates = MemberBeanMembersMemberPlates();
  final String? createName = jsonConvert.convert<String>(json['createName']);
  if (createName != null) {
    memberBeanMembersMemberPlates.createName = createName;
  }
  final String? createTime = jsonConvert.convert<String>(json['createTime']);
  if (createTime != null) {
    memberBeanMembersMemberPlates.createTime = createTime;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    memberBeanMembersMemberPlates.id = id;
  }
  final int? isCommonly = jsonConvert.convert<int>(json['isCommonly']);
  if (isCommonly != null) {
    memberBeanMembersMemberPlates.isCommonly = isCommonly;
  }
  final int? isDeleted = jsonConvert.convert<int>(json['isDeleted']);
  if (isDeleted != null) {
    memberBeanMembersMemberPlates.isDeleted = isDeleted;
  }
  final String? mchMemberId = jsonConvert.convert<String>(json['mchMemberId']);
  if (mchMemberId != null) {
    memberBeanMembersMemberPlates.mchMemberId = mchMemberId;
  }
  final String? memberAccountId = jsonConvert.convert<String>(json['memberAccountId']);
  if (memberAccountId != null) {
    memberBeanMembersMemberPlates.memberAccountId = memberAccountId;
  }
  final String? plateNo = jsonConvert.convert<String>(json['plateNo']);
  if (plateNo != null) {
    memberBeanMembersMemberPlates.plateNo = plateNo;
  }
  final String? plateType = jsonConvert.convert<String>(json['plateType']);
  if (plateType != null) {
    memberBeanMembersMemberPlates.plateType = plateType;
  }
  final String? updateName = jsonConvert.convert<String>(json['updateName']);
  if (updateName != null) {
    memberBeanMembersMemberPlates.updateName = updateName;
  }
  final String? updateTime = jsonConvert.convert<String>(json['updateTime']);
  if (updateTime != null) {
    memberBeanMembersMemberPlates.updateTime = updateTime;
  }
  final String? url = jsonConvert.convert<String>(json['url']);
  if (url != null) {
    memberBeanMembersMemberPlates.url = url;
  }
  return memberBeanMembersMemberPlates;
}

Map<String, dynamic> $MemberBeanMembersMemberPlatesToJson(MemberBeanMembersMemberPlates entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['createName'] = entity.createName;
  data['createTime'] = entity.createTime;
  data['id'] = entity.id;
  data['isCommonly'] = entity.isCommonly;
  data['isDeleted'] = entity.isDeleted;
  data['mchMemberId'] = entity.mchMemberId;
  data['memberAccountId'] = entity.memberAccountId;
  data['plateNo'] = entity.plateNo;
  data['plateType'] = entity.plateType;
  data['updateName'] = entity.updateName;
  data['updateTime'] = entity.updateTime;
  data['url'] = entity.url;
  return data;
}

extension MemberBeanMembersMemberPlatesExtension on MemberBeanMembersMemberPlates {
  MemberBeanMembersMemberPlates copyWith({
    String? createName,
    String? createTime,
    String? id,
    int? isCommonly,
    int? isDeleted,
    String? mchMemberId,
    String? memberAccountId,
    String? plateNo,
    String? plateType,
    String? updateName,
    String? updateTime,
    String? url,
  }) {
    return MemberBeanMembersMemberPlates()
      ..createName = createName ?? this.createName
      ..createTime = createTime ?? this.createTime
      ..id = id ?? this.id
      ..isCommonly = isCommonly ?? this.isCommonly
      ..isDeleted = isDeleted ?? this.isDeleted
      ..mchMemberId = mchMemberId ?? this.mchMemberId
      ..memberAccountId = memberAccountId ?? this.memberAccountId
      ..plateNo = plateNo ?? this.plateNo
      ..plateType = plateType ?? this.plateType
      ..updateName = updateName ?? this.updateName
      ..updateTime = updateTime ?? this.updateTime
      ..url = url ?? this.url;
  }
}

MemberBeanMembersSimpleTagInfoResponses $MemberBeanMembersSimpleTagInfoResponsesFromJson(Map<String, dynamic> json) {
  final MemberBeanMembersSimpleTagInfoResponses memberBeanMembersSimpleTagInfoResponses = MemberBeanMembersSimpleTagInfoResponses();
  final String? businessType = jsonConvert.convert<String>(json['businessType']);
  if (businessType != null) {
    memberBeanMembersSimpleTagInfoResponses.businessType = businessType;
  }
  final String? tagId = jsonConvert.convert<String>(json['tagId']);
  if (tagId != null) {
    memberBeanMembersSimpleTagInfoResponses.tagId = tagId;
  }
  final String? tagName = jsonConvert.convert<String>(json['tagName']);
  if (tagName != null) {
    memberBeanMembersSimpleTagInfoResponses.tagName = tagName;
  }
  return memberBeanMembersSimpleTagInfoResponses;
}

Map<String, dynamic> $MemberBeanMembersSimpleTagInfoResponsesToJson(MemberBeanMembersSimpleTagInfoResponses entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['businessType'] = entity.businessType;
  data['tagId'] = entity.tagId;
  data['tagName'] = entity.tagName;
  return data;
}

extension MemberBeanMembersSimpleTagInfoResponsesExtension on MemberBeanMembersSimpleTagInfoResponses {
  MemberBeanMembersSimpleTagInfoResponses copyWith({
    String? businessType,
    String? tagId,
    String? tagName,
  }) {
    return MemberBeanMembersSimpleTagInfoResponses()
      ..businessType = businessType ?? this.businessType
      ..tagId = tagId ?? this.tagId
      ..tagName = tagName ?? this.tagName;
  }
}